package game.components;

import com.uqbar.vainilla.DeltaState;

public class TimerLabel extends InformationLabel {

	private int minutes;
	private int seconds;
	
	private TimerState state = new WorkingTimer(this);
	private int refreshTime  = 10;
	
	public TimerLabel(double x, double y, int minute, int second) {
		super(x, y);
		this.setMinutes(minute);
		this.setSeconds(second);
	}
	
	@Override
	public void update(DeltaState deltaState) {
		this.getState().update(deltaState);
		super.update(deltaState);
	}
	
	public void freeze() {
		this.setState(new FrozenTimer(this));
	}
	
	public void reset() {
		this.setMinutes(0);
		this.setSeconds(0);
	}
	
	
	
	
	
	

	public int getMinutes() {
		return minutes;
	}

	public void setMinutes(int minutes) {
		this.minutes = minutes;
	}

	public int getSeconds() {
		return seconds;
	}

	public void setSeconds(int seconds) {
		this.seconds = seconds;
	}

	public int getRefreshTime() {
		return refreshTime;
	}

	public void setRefreshTime(int waitingTime) {
		this.refreshTime = waitingTime;
	}

	public TimerState getState() {
		return state;
	}

	public void setState(TimerState state) {
		this.state = state;
	}

}
